Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(7.1) Fix the issue that primary pessimistic lock may be left not cleared after GC (#866) #870

Conversation

MyonKeminta
Copy link
Contributor

Cherry-picks #866 to tidb-7.1 branch
Ref pingcap/tidb#45134

The problem is that BatchResolveLock calls resolvePessimsticLock without calling getTxnStatus, but resolvePessimsticLock assumes getTxnStatus (in which CheckTxnStatus RPC is called) is done so it doesn't do anything to primary pessimistic lock. This may result in residue pessimistic locks in some rare cases.

This PR moves resolvePessimsticLock calling to after getTxnStatus to avoid the problem.

…fter GC (tikv#866)

* Fix the issue that primary pessimistic lock may be left not cleared after GC

Signed-off-by: MyonKeminta <[email protected]>

* Fix mysteriously shown up thing that makes compilation failed

Signed-off-by: MyonKeminta <[email protected]>

* Fix test effectiveness (forgot to set txn2 to pessimistic txn); add more strict checks

Signed-off-by: MyonKeminta <[email protected]>

* Address comments

Signed-off-by: MyonKeminta <[email protected]>

---------

Signed-off-by: MyonKeminta <[email protected]>
Co-authored-by: MyonKeminta <[email protected]>
@MyonKeminta MyonKeminta requested review from cfzjywxk and ekexium July 4, 2023 08:54
@cfzjywxk cfzjywxk merged commit 56f822e into tikv:tidb-7.1 Jul 4, 2023
@MyonKeminta MyonKeminta deleted the m/fix-batch-resolve-lock-miss-primary-pessimistic-lock-7.1 branch July 5, 2023 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants